package service.impl;

import javax.annotation.Resource;

import org.springframework.stereotype.Component;

import dao.UserDao;
import pojo.User;
import service.UserService;

@Component(value="userService")
public class UserServiceImpl implements UserService{

	public UserServiceImpl() {
		System.out.println("service");
	}
	
	@Resource(name="JAPdao")
	private UserDao userDao;
	
	@Override
	public User login(User user) {
		userDao.addUser(user);
		return user;
	}

	@Override
	public User findByName(String name, String pwd) {
		User user = userDao.findByName(name, pwd);
		return user;
	}

}
